#ifndef CEXCELREADER
#define CEXCELREADER
#include <cppcommon.h>
class CExcelReader
{
public:
	class CExcelValue
	{
	private:
		STRING m_strValue;
		DOUBLE m_numValue;
	public:
#ifdef _LIBEXCEL
		CExcelValue(STRING _strValue, DOUBLE _numValue);
		~CExcelValue();
#endif
		virtual STRING getString();
		virtual DOUBLE getNumber();
	};
	class CExcelRow
	{
	private:
		typedef VECTOR<CExcelValue> ExcelRow;
		ExcelRow m_Row;
		CExcelReader* m_pReader;
	public:
#ifdef _LIBEXCEL
		CExcelRow(CExcelReader* _pReader);
		~CExcelRow();
		bool Init(INT _RowIndex);
#endif
		virtual CExcelValue& operator [] (const DWORD _index);
	};
private:
	typedef VECTOR<CExcelRow> ExcelTable;
	ExcelTable m_Table;
	void* m_pWS;
	void* m_pWB;
	INT m_MaxRow;
	INT m_MaxColumn;
public:
#ifdef _LIBEXCEL
	CExcelReader();
#endif
	virtual ~CExcelReader();
	virtual bool Init(STRING _FullFilePath, STRING _CharSet);
	virtual bool Init(STRING _FullFilePath, STRING _SheetName, STRING _CharSet);
	virtual bool getWS(STRING _SheetName);
	virtual INT get_RowCount();
	virtual INT get_ColumnCount();
	virtual CExcelRow& operator [] (const DWORD _index);
#ifdef _LIBEXCEL
	void* getTablePoint();
#endif
};


#ifdef _MSC_VER
#ifdef _LIBEXCEL
#define _DLLFUNC __declspec(dllexport)
#else
#define _DLLFUNC __declspec(dllimport)
#endif
#else
#define _DLLFUNC
#endif



typedef CExcelReader* PCExcelReader;
typedef PCExcelReader (*PCExcelReaderCreater)();
extern "C" _DLLFUNC PCExcelReader CreateNewPCExcelReader();

#endif

